package com.xiaoshuidi.cloud.module.contract.dal.mysql.fee;


import com.xiaoshuidi.cloud.framework.mybatis.core.mapper.BaseMapperX;
import com.xiaoshuidi.cloud.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.xiaoshuidi.cloud.module.contract.dal.dataobject.fee.FeeTypesDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 基本费项 Mapper
 *
 * @author 合房租赁
 */
@Mapper
public interface FeeTypesMapper extends BaseMapperX<FeeTypesDO> {
    default List<FeeTypesDO> getFeeTypesByName(String feeName,List<Long> tenantIds) {
        return selectList(new LambdaQueryWrapperX<FeeTypesDO>()
                .like(FeeTypesDO::getFeeName, feeName)
                .in(FeeTypesDO::getTenantId, tenantIds)
                .orderByDesc(FeeTypesDO::getFeeName)
                );
    }

    FeeTypesDO getFeeTypes(@Param("feeName") String feeName, @Param("tenantId") Long tenantId);

}
